home *** CD-ROM | disk | FTP | other *** search
/ Over 1,000 Windows 95 Programs / Over 1000 Windows 95 Programs (Microforum) (Disc 1).iso / 1470 / 3dframes.frm (.txt) < prev    next >
Visual Basic Form  |  1996-06-08  |  16KB  |  530 lines

  1. VERSION 4.00
  2. Begin VB.Form frm3DFrames 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    Caption         =   "VBMax 3D Effects Demo - Frames"
  5.    ClientHeight    =   5745
  6.    ClientLeft      =   840
  7.    ClientTop       =   1365
  8.    ClientWidth     =   7215
  9.    Height          =   6150
  10.    Icon            =   "3DFrames.frx":0000
  11.    Left            =   780
  12.    LinkTopic       =   "Form1"
  13.    LockControls    =   -1  'True
  14.    MaxButton       =   0   'False
  15.    MinButton       =   0   'False
  16.    ScaleHeight     =   5745
  17.    ScaleWidth      =   7215
  18.    ShowInTaskbar   =   0   'False
  19.    Top             =   1020
  20.    Width           =   7335
  21.    Begin VB.PictureBox picFrameBorderStyle 
  22.       BorderStyle     =   0  'None
  23.       Height          =   1035
  24.       Left            =   4920
  25.       ScaleHeight     =   1035
  26.       ScaleWidth      =   2115
  27.       TabIndex        =   40
  28.       Top             =   4140
  29.       Width           =   2115
  30.       Begin VB.OptionButton optFrameEffect 
  31.          Caption         =   "Recessed"
  32.          Height          =   255
  33.          Index           =   1
  34.          Left            =   120
  35.          TabIndex        =   31
  36.          Top             =   480
  37.          Width           =   1155
  38.       End
  39.       Begin VB.OptionButton optFrameEffect 
  40.          Caption         =   "Raised"
  41.          Height          =   255
  42.          Index           =   0
  43.          Left            =   120
  44.          TabIndex        =   30
  45.          Top             =   120
  46.          Value           =   -1  'True
  47.          Width           =   915
  48.       End
  49.    End
  50.    Begin VB.CommandButton cmdClose 
  51.       Cancel          =   -1  'True
  52.       Caption         =   "Close"
  53.       Height          =   360
  54.       Left            =   6165
  55.       TabIndex        =   32
  56.       Top             =   5340
  57.       Width           =   900
  58.    End
  59.    Begin VB.PictureBox picFrameAlign 
  60.       BorderStyle     =   0  'None
  61.       Height          =   1035
  62.       Left            =   1800
  63.       ScaleHeight     =   1035
  64.       ScaleWidth      =   2835
  65.       TabIndex        =   39
  66.       Top             =   4140
  67.       Width           =   2835
  68.       Begin VB.OptionButton optAlign 
  69.          Caption         =   "Center"
  70.          Height          =   255
  71.          Index           =   2
  72.          Left            =   120
  73.          TabIndex        =   29
  74.          Top             =   720
  75.          Width           =   855
  76.       End
  77.       Begin VB.OptionButton optAlign 
  78.          Caption         =   "Right Justify"
  79.          Height          =   255
  80.          Index           =   1
  81.          Left            =   120
  82.          TabIndex        =   28
  83.          Top             =   420
  84.          Width           =   1275
  85.       End
  86.       Begin VB.OptionButton optAlign 
  87.          Caption         =   "Left Justify"
  88.          Height          =   255
  89.          Index           =   0
  90.          Left            =   120
  91.          TabIndex        =   27
  92.          Top             =   120
  93.          Value           =   -1  'True
  94.          Width           =   1095
  95.       End
  96.    End
  97.    Begin VB.PictureBox picFrameShadow 
  98.       BorderStyle     =   0  'None
  99.       Height          =   1035
  100.       Left            =   180
  101.       ScaleHeight     =   1035
  102.       ScaleWidth      =   1395
  103.       TabIndex        =   38
  104.       Top             =   4140
  105.       Width           =   1395
  106.       Begin VB.OptionButton optShadow 
  107.          Caption         =   "Light"
  108.          Height          =   255
  109.          Index           =   0
  110.          Left            =   120
  111.          TabIndex        =   25
  112.          Top             =   120
  113.          Value           =   -1  'True
  114.          Width           =   795
  115.       End
  116.       Begin VB.OptionButton optShadow 
  117.          Caption         =   "Dark"
  118.          Height          =   255
  119.          Index           =   1
  120.          Left            =   120
  121.          TabIndex        =   26
  122.          Top             =   480
  123.          Width           =   795
  124.       End
  125.    End
  126.    Begin VB.PictureBox picFrameStyle 
  127.       BorderStyle     =   0  'None
  128.       Height          =   2955
  129.       Left            =   4920
  130.       ScaleHeight     =   2955
  131.       ScaleWidth      =   2115
  132.       TabIndex        =   37
  133.       Top             =   540
  134.       Width           =   2115
  135.       Begin VB.OptionButton optEffect 
  136.          Caption         =   "Normal"
  137.          Height          =   255
  138.          Index           =   0
  139.          Left            =   120
  140.          TabIndex        =   16
  141.          Top             =   120
  142.          Width           =   915
  143.       End
  144.       Begin VB.OptionButton optEffect 
  145.          Caption         =   "Raised"
  146.          Height          =   255
  147.          Index           =   1
  148.          Left            =   120
  149.          TabIndex        =   17
  150.          Top             =   420
  151.          Value           =   -1  'True
  152.          Width           =   915
  153.       End
  154.       Begin VB.OptionButton optEffect 
  155.          Caption         =   "Recessed"
  156.          Height          =   255
  157.          Index           =   2
  158.          Left            =   120
  159.          TabIndex        =   18
  160.          Top             =   720
  161.          Width           =   1155
  162.       End
  163.       Begin VB.OptionButton optEffect 
  164.          Caption         =   "Embossed Raised"
  165.          Height          =   255
  166.          Index           =   3
  167.          Left            =   120
  168.          TabIndex        =   19
  169.          Top             =   1020
  170.          Width           =   1695
  171.       End
  172.       Begin VB.OptionButton optEffect 
  173.          Caption         =   "Embossed Recessed"
  174.          Height          =   255
  175.          Index           =   4
  176.          Left            =   120
  177.          TabIndex        =   20
  178.          Top             =   1320
  179.          Width           =   1995
  180.       End
  181.       Begin VB.OptionButton optEffect 
  182.          Caption         =   "Floating"
  183.          Height          =   255
  184.          Index           =   5
  185.          Left            =   120
  186.          TabIndex        =   21
  187.          Top             =   1620
  188.          Width           =   915
  189.       End
  190.       Begin VB.OptionButton optEffect 
  191.          Caption         =   "Outline Right"
  192.          Height          =   255
  193.          Index           =   6
  194.          Left            =   120
  195.          TabIndex        =   22
  196.          Top             =   1920
  197.          Width           =   1335
  198.       End
  199.       Begin VB.OptionButton optEffect 
  200.          Caption         =   "Outline Left"
  201.          Height          =   255
  202.          Index           =   7
  203.          Left            =   120
  204.          TabIndex        =   23
  205.          Top             =   2220
  206.          Width           =   1275
  207.       End
  208.       Begin VB.OptionButton optEffect 
  209.          Caption         =   "Projected"
  210.          Height          =   255
  211.          Index           =   8
  212.          Left            =   120
  213.          TabIndex        =   24
  214.          Top             =   2520
  215.          Width           =   1155
  216.       End
  217.    End
  218.    Begin VB.PictureBox picFrameFont 
  219.       BorderStyle     =   0  'None
  220.       Height          =   2955
  221.       Left            =   1800
  222.       ScaleHeight     =   2955
  223.       ScaleWidth      =   2835
  224.       TabIndex        =   34
  225.       Top             =   540
  226.       Width           =   2835
  227.       Begin VB.CommandButton cmdSelectFont 
  228.          Caption         =   "Font Dialog"
  229.          Height          =   315
  230.          Left            =   1320
  231.          TabIndex        =   15
  232.          Top             =   2520
  233.          Width           =   1155
  234.       End
  235.       Begin VB.CheckBox chkStrikeout 
  236.          Caption         =   "Strikeout"
  237.          Height          =   315
  238.          Left            =   1320
  239.          TabIndex        =   14
  240.          Top             =   2100
  241.          Width           =   1095
  242.       End
  243.       Begin VB.CheckBox chkUnderline 
  244.          Caption         =   "Underline"
  245.          Height          =   315
  246.          Left            =   1320
  247.          TabIndex        =   13
  248.          Top             =   1740
  249.          Width           =   1095
  250.       End
  251.       Begin VB.CheckBox chkItalic 
  252.          Caption         =   "Italic"
  253.          Height          =   315
  254.          Left            =   1320
  255.          TabIndex        =   12
  256.          Top             =   1380
  257.          Width           =   795
  258.       End
  259.       Begin VB.CheckBox chkBold 
  260.          Caption         =   "Bold"
  261.          Height          =   315
  262.          Left            =   1320
  263.          TabIndex        =   11
  264.          Top             =   1020
  265.          Width           =   795
  266.       End
  267.       Begin VB.ComboBox cboTextSize 
  268.          Height          =   1740
  269.          Left            =   120
  270.          Style           =   1  'Simple Combo
  271.          TabIndex        =   10
  272.          Top             =   1080
  273.          Width           =   915
  274.       End
  275.       Begin VB.ComboBox cboFontNames 
  276.          Height          =   315
  277.          Left            =   120
  278.          Sorted          =   -1  'True
  279.          Style           =   2  'Dropdown List
  280.          TabIndex        =   9
  281.          Top             =   360
  282.          Width           =   2535
  283.       End
  284.       Begin VB.Label Label3 
  285.          AutoSize        =   -1  'True
  286.          Caption         =   "Size:"
  287.          Height          =   195
  288.          Left            =   120
  289.          TabIndex        =   36
  290.          Top             =   840
  291.          Width           =   345
  292.       End
  293.       Begin VB.Label Label2 
  294.          AutoSize        =   -1  'True
  295.          Caption         =   "Name:"
  296.          Height          =   195
  297.          Left            =   120
  298.          TabIndex        =   35
  299.          Top             =   120
  300.          Width           =   465
  301.       End
  302.    End
  303.    Begin VB.PictureBox picFrameColor 
  304.       BorderStyle     =   0  'None
  305.       Height          =   2955
  306.       Left            =   180
  307.       ScaleHeight     =   2955
  308.       ScaleWidth      =   1395
  309.       TabIndex        =   33
  310.       Top             =   540
  311.       Width           =   1395
  312.       Begin VB.CommandButton cmdSelectColor 
  313.          Caption         =   "Color Dialog"
  314.          Height          =   315
  315.          Left            =   120
  316.          TabIndex        =   8
  317.          Top             =   2580
  318.          Width           =   1155
  319.       End
  320.       Begin VB.OptionButton optColor 
  321.          Caption         =   "Black"
  322.          ForeColor       =   &H00000000&
  323.          Height          =   255
  324.          Index           =   1
  325.          Left            =   120
  326.          TabIndex        =   0
  327.          Top             =   120
  328.          Width           =   1095
  329.       End
  330.       Begin VB.OptionButton optColor 
  331.          Caption         =   "Red"
  332.          ForeColor       =   &H000000FF&
  333.          Height          =   255
  334.          Index           =   2
  335.          Left            =   120
  336.          TabIndex        =   1
  337.          Top             =   420
  338.          Width           =   1095
  339.       End
  340.       Begin VB.OptionButton optColor 
  341.          Caption         =   "Green"
  342.          ForeColor       =   &H0000FF00&
  343.          Height          =   255
  344.          Index           =   3
  345.          Left            =   120
  346.          TabIndex        =   2
  347.          Top             =   720
  348.          Width           =   1095
  349.       End
  350.       Begin VB.OptionButton optColor 
  351.          Caption         =   "Yellow"
  352.          ForeColor       =   &H0000FFFF&
  353.          Height          =   255
  354.          Index           =   4
  355.          Left            =   120
  356.          TabIndex        =   3
  357.          Top             =   1020
  358.          Width           =   1095
  359.       End
  360.       Begin VB.OptionButton optColor 
  361.          Caption         =   "Blue"
  362.          ForeColor       =   &H00FF0000&
  363.          Height          =   255
  364.          Index           =   5
  365.          Left            =   120
  366.          TabIndex        =   4
  367.          Top             =   1320
  368.          Value           =   -1  'True
  369.          Width           =   1095
  370.       End
  371.       Begin VB.OptionButton optColor 
  372.          Caption         =   "Magenta"
  373.          ForeColor       =   &H00FF00FF&
  374.          Height          =   255
  375.          Index           =   6
  376.          Left            =   120
  377.          TabIndex        =   5
  378.          Top             =   1620
  379.          Width           =   1095
  380.       End
  381.       Begin VB.OptionButton optColor 
  382.          Caption         =   "Cyan"
  383.          ForeColor       =   &H00FFFF00&
  384.          Height          =   255
  385.          Index           =   7
  386.          Left            =   120
  387.          TabIndex        =   6
  388.          Top             =   1920
  389.          Width           =   1095
  390.       End
  391.       Begin VB.OptionButton optColor 
  392.          Caption         =   "White"
  393.          ForeColor       =   &H00FFFFFF&
  394.          Height          =   255
  395.          Index           =   8
  396.          Left            =   120
  397.          TabIndex        =   7
  398.          Top             =   2220
  399.          Width           =   1095
  400.       End
  401.    End
  402. Attribute VB_Name = "frm3DFrames"
  403. Attribute VB_Creatable = False
  404. Attribute VB_Exposed = False
  405. Option Explicit
  406. Dim mo3D As New C3D
  407. Private Sub cmdClose_Click()
  408.     Unload Me
  409. End Sub
  410. Private Sub Form_Load()
  411. Dim i As Integer
  412.     CenterForm Me
  413.         
  414.     With cboFontNames
  415.         For i = 0 To Screen.FontCount - 1
  416.             .AddItem Screen.Fonts(i)
  417.         Next i
  418.     End With
  419.     With cboTextSize
  420.         .AddItem "8"
  421.         .AddItem "10"
  422.         .AddItem "12"
  423.         .AddItem "14"
  424.         .AddItem "20"
  425.         .AddItem "24"
  426.         .AddItem "26"
  427.         .AddItem "32"
  428.     End With
  429.     With mo3D
  430.         .Style = gnNORMAL
  431.         .ForeColor = vbBlue
  432.         .Style = gnRAISED
  433.     End With
  434.     RedrawFrames
  435. End Sub
  436. Private Sub Form_Unload(Cancel As Integer)
  437.     Set mo3D = Nothing
  438.     Set frm3DFrames = Nothing
  439. End Sub
  440. Sub RedrawFrames()
  441. Dim nFrameStyle As Integer
  442.     If optFrameEffect(0).Value Then
  443.         nFrameStyle = gnRAISED
  444.     Else
  445.         nFrameStyle = gnRECESSED
  446.     End If
  447.     Cls
  448.     With mo3D
  449.         .Frame picFrameColor, "Color", nFrameStyle
  450.         .Frame picFrameAlign, "Alignment", nFrameStyle
  451.         .Frame picFrameFont, "Font", nFrameStyle
  452.         .Frame picFrameShadow, "Shadow", nFrameStyle
  453.         .Frame picFrameStyle, "Effect", nFrameStyle
  454.         .Frame picFrameBorderStyle, "Frame", nFrameStyle
  455.     End With
  456. End Sub
  457. Private Sub optColor_Click(Index As Integer)
  458.     mo3D.ForeColor = optColor(Index).ForeColor
  459.     RedrawFrames
  460. End Sub
  461. Private Sub cboFontNames_Click()
  462.     mo3D.FontName = cboFontNames.Text
  463.     RedrawFrames
  464. End Sub
  465. Private Sub cboTextSize_Click()
  466.     cboTextSize_Change
  467. End Sub
  468. Private Sub cboTextSize_Change()
  469.     mo3D.FontSize = Val(cboTextSize.Text)
  470.     RedrawFrames
  471. End Sub
  472. Private Sub chkBold_Click()
  473.     If chkBold.Value = vbChecked Then
  474.         mo3D.FontBold = True
  475.     Else
  476.         mo3D.FontBold = False
  477.     End If
  478.     RedrawFrames
  479. End Sub
  480. Private Sub chkItalic_Click()
  481.     If chkItalic.Value = vbChecked Then
  482.          mo3D.FontItalic = True
  483.     Else
  484.          mo3D.FontItalic = False
  485.     End If
  486.     RedrawFrames
  487. End Sub
  488. Private Sub chkStrikeout_Click()
  489.     If chkStrikeout.Value = vbChecked Then
  490.         mo3D.FontStrikethru = True
  491.     Else
  492.         mo3D.FontStrikethru = False
  493.     End If
  494.     RedrawFrames
  495. End Sub
  496. Private Sub optEffect_Click(Index As Integer)
  497.     mo3D.Style = Index
  498.     RedrawFrames
  499. End Sub
  500. Private Sub optShadow_Click(Index As Integer)
  501.     Select Case Index
  502.         Case 0: mo3D.Shadow = gnLIGHT_SHADOW
  503.         Case 1: mo3D.Shadow = gnDARK_SHADOW
  504.     End Select
  505.     RedrawFrames
  506. End Sub
  507. Private Sub optAlign_Click(Index As Integer)
  508.     mo3D.Alignment = Index
  509.     RedrawFrames
  510. End Sub
  511. Private Sub chkUnderline_Click()
  512.     If chkUnderline.Value = vbChecked Then
  513.         mo3D.FontUnderline = True
  514.     Else
  515.         mo3D.FontUnderline = False
  516.     End If
  517.     RedrawFrames
  518. End Sub
  519. Private Sub optFrameEffect_Click(Index As Integer)
  520.     RedrawFrames
  521. End Sub
  522. Private Sub cmdSelectColor_Click()
  523.     mo3D.SelectForeColor
  524.     RedrawFrames
  525. End Sub
  526. Private Sub cmdSelectFont_Click()
  527.     mo3D.SelectFont
  528.     RedrawFrames
  529. End Sub
  530.